package com.cby.operation.anti.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * Description:PopConfigBean
 *
 * @author 陈宝阳
 * @create 2019/12/31 14: 56
 */
data class PopConfigBean(
    var type: Int = 0,
    var onlyFirst: Int = 0,
    var moment: Int = 0,
    var title: String? = null,
    var content: String? = null,
    var tips: List<String>? = null,
    var linkBean: LinkBean? = null,
    var buttonBeanList: List<ButtonBean>? = null,
    var finalBean: FinalBean? = null,
    var closeButtonBean: CloseButtonBean? = null
) : Parcelable {

    constructor(parcel: Parcel) : this(
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.createStringArrayList(),
        parcel.readParcelable(LinkBean::class.java.classLoader),
        parcel.createTypedArrayList(ButtonBean),
        parcel.readParcelable(FinalBean::class.java.classLoader),
        parcel.readParcelable(CloseButtonBean::class.java.classLoader)
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(type)
        parcel.writeInt(onlyFirst)
        parcel.writeInt(moment)
        parcel.writeString(title)
        parcel.writeString(content)
        parcel.writeStringList(tips)
        parcel.writeParcelable(linkBean, flags)
        parcel.writeTypedList(buttonBeanList)
        parcel.writeParcelable(finalBean, flags)
        parcel.writeParcelable(closeButtonBean, flags)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<PopConfigBean> {
        override fun createFromParcel(parcel: Parcel): PopConfigBean {
            return PopConfigBean(parcel)
        }

        override fun newArray(size: Int): Array<PopConfigBean?> {
            return arrayOfNulls(size)
        }
    }


}